//Copyright 2010 Balazs Keri, Imre Keri
//
//This file is part of FireworksCreator.
//
//FireworksCreator is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//FireworksCreator is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with FireworksCreator.  If not, see <http://www.gnu.org/licenses/>.
//
#include "particleshooter.h"
#include "particletemplate.h"
//
namespace model
{
ParticleShooter::ParticleShooter(QObject *p_parent)
:
   Shooter(p_parent),
   time(0.0),particle_template(0)
{}
//
double ParticleShooter::get_time()const
{
   return time;
}
void ParticleShooter::set_time(double p_time)
{
   time=p_time;
}
const osg::Vec3 &ParticleShooter::get_position()const
{
   return position;
}
void ParticleShooter::set_position(const osg::Vec3 &p_position)
{
   position=p_position;
}
const osg::Vec3 &ParticleShooter::get_angle()const
{
   return angle;
}
void ParticleShooter::set_angle(const osg::Vec3 &p_angle)
{
   angle=p_angle;
}
const osg::Vec3 &ParticleShooter::get_velocity()const
{
   return velocity;
}
void ParticleShooter::set_velocity(const osg::Vec3 &p_velocity)
{
   velocity=p_velocity;
}
const osg::Vec3 &ParticleShooter::get_angular_velocity()const
{
   return angular_velocity;
}
void ParticleShooter::set_angular_velocity(const osg::Vec3 &p_angular_velocity)
{
   angular_velocity=p_angular_velocity;
}
ParticleTemplate *ParticleShooter::get_particle_template()const
{
   return particle_template;
}
void ParticleShooter::set_particle_template(ParticleTemplate *p_particle_template)
{
   particle_template=p_particle_template;
}
double ParticleShooter::get_start_time_impl()const
{
   return time;
}
void ParticleShooter::store_data_impl(QDataStream &p_stream)const
{
   Shooter::store_data_impl(p_stream);
   p_stream<<time<<position<<velocity<<angular_velocity<<particle_template;
}
void ParticleShooter::restore_data_impl(RestoreStream &p_stream)
{
   Shooter::restore_data_impl(p_stream);
   p_stream>>time>>position>>velocity>>angular_velocity;//>>static_cast<Identified*&>(particle_template);
}
}